<template>
    <div v-if="tkIsShow">
        <div class="zhezhao"></div>
        <div class="tankuang">
            <div class="tk_title">{{ title }}</div>
            <img src="../assets/icon-close.png" class="tk_close" @click="closeTk">
            <div class="tk_content">
              <el-table
                :data="tableData"
                style="width: 100%;"
                height="92%">
                <el-table-column
                  prop="lxrname"
                  label="联系人"
                  width="120">
                </el-table-column>
                <el-table-column
                  prop="lxrtell"
                  label="联系电话"
                  width="120">
                </el-table-column>
                <el-table-column
                  label="联系地址"
                  width="200">
                  <template slot-scope="scope">
                    <div>{{ scope.row.province }}{{ scope.row.city }}{{ scope.row.district }}{{ scope.row.lxraddress }}</div>
                  </template>
                </el-table-column>
                <el-table-column
                  label="是否默认"
                  width="100">
                    <template slot-scope="scope">
                      <div v-if="scope.row.isDefault==1">是</div>
                      <div v-if="scope.row.isDefault==0">否</div>
                    </template>
                  </el-table-column>
              </el-table>
            </div>
        </div>
    </div>
</template>
<script>
export default {
  data() {
    return {
        tkIsShow:false,
        title:"",
        uuid:'',
        tableData:[]
    };
  },
  methods: {
    __init(uuid) {
      this.uuid=uuid;
      this.getAllAddressByUuid();
    },
    getAllAddressByUuid(){
      var url="userApi/getAllAddressByUuid";
      var params={
        uuid: this.uuid,
      }
      this.$post(url, params).then((res) => {
        console.log(res)
        if (res.code === 0) {
          this.tableData=res.data;
        } else {
          this.$message.error(res.msg)
        }
      });
    },
    closeTk(){
        this.tkIsShow = false;
        this.$emit("close");
    }
  }
}
</script>
<style scoped lang="scss">
  .zhezhao{
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0.2;
    top: 0;
    left: 0;
    z-index: 100;
  }
  .tankuang{
    position: fixed;
    width: 36%;
    height: 440px;
    background-color: #fff;
    top: 15%;
    left: 32%;
    z-index: 101;
    border-radius: 5px;
  }
  .tk_title{
    font-size: 17px;
    margin: 15px 0;
    height: 25px;
    line-height: 25px;
  }
  .tk_content{
    width: 90%;
    margin-left: 5%;
    height: calc(100% - 55px);
  }
  .tk_close{
    position: absolute;
    width: 16px;
    height: 16px;
    top: 18px;
    right: 20px;
  }
</style>